Contents | < Browse | Browse >
ZShell supports wild card file descriptions on some commands
( DIR , LIST , DELETE , COPY , CONFIG , JOIN , MOVE , PROTECT )
Important: If you want to use | as part of a wild card, you have to
precede it by or enclose the wild card by quotes. This is to avoid
to be treated as an pipe . Example:
dir ram:(*.info|*.bak)
or dir "ram:(*.info|*.bak)"
instead of dir ram:(*.info|*.bak)
OS2.0+ note: The default is to use AmigaDOS wildcard patternmatching.
It is localized and has not the limitations of the internal matcher.
But you have to be careful when looking at the examples in this
documentation, because they are made for the internal matcher.
(You can even use * instead of #? with the AmigaDOS matcher, because the
wildstar flag is set by ZShell in the system for all programs. Please
tell me if this makes problems.)
To switch back to the internal matcher use: FLAGS WILD OFF
AmigaDOS patternmatcher:
? Matches a single character.
# Matches the following expression 0 or more times.
(ab|cd) Matches any one of the items seperated by '|'.
~ Negates the following expression. It matches all strings
that do not match the expression (aka ~(foo) matches all
strings that are not exactly "foo").
[abc] Character class: matches any of the characters in the class.
[~bc] Character class: matches any of the characters not in the
class.
a-z Character range (only within character classes).
% Matches 0 characters always (useful in "(foo|bar|%)").
* Synonym for "#?", not available by default in OS2.0,
but is switched on by ZShell.
"Expression" in the above table means either a single character
(ex: "#?"), or an alternation (ex: "#(ab|cd|ef)"), or a character
class (ex: "#[a-zA-Z]").
The following refers to the internal patternmatcher:
Wild cards are like those supported on MessyDOS or UNICS systems, and not
the same as the ones on AmigaDOS. So use * instead of #? .
NOTE: You can only effectively put one * character in a wild card.
Character Meaning
* Match zero or more characters.
? Match one character.
~ Negates the following wildcard.
[ ] Specifies a class of characters to match.
(One of the characters in the brackets must match)
| Separate multiple filenames (can be wildcards)
(One of the file descriptions separated by | must match)
To get that just try the examples following and try it out with DIR .
eg. list *.info {lists all files ending in .info}
dir z*.s {lists all files starting z, ending in .s}
delete df0:*.info {deletes all .info files from df0:}
copy *.s ram: {copies all .s files to ram:}
copy 1? df0: {copies all two char files beginning with 1}
dir ~*.s {lists all files NOT ending in .s}
list ~*.info {lists all files except for .info files}
dir *.[co] {lists files ending in .c or .o}
list [abcd]* {lists files beginning with a,b,c or d}
list c:mount|version {lists the files Mount and Version}
{OS2.0+ this would be: list c:(mount|version) }
list ram:env/a*|*b {lists all files starting with a or
ending with b from RAM:env (environment)}
copy ~*.info|*.bak {copies all files NOT ending in .info
and NOT ending in .bak}